#!/bin/bash

FILE=$1

if [[ "$#" != 1 ]]
then
        echo "Wrong number of parameters. Expected 1." >&2
        exit 1
fi

if ! [[ -e "$FILE" ]]
then
        echo "Could not find the file." >&2
        exit 1
fi


NUMBER_OF_STATS_TYPES=10

READ_STATISTICS=./read_statistics.sh
PARSE_STATISTICS=./parse_statistics.sh

for type in $(seq 1 $NUMBER_OF_STATS_TYPES)
do
	$READ_STATISTICS $FILE $type | $PARSE_STATISTICS
done
